//
//  ZM_Lbl_CollectionReuseV.m
//  YYFMMall
//
//  Created by MAC on 2019/12/11.
//  Copyright © 2019 YuYou1. All rights reserved.
//

#import "ZM_Lbl_CollectionReuseV.h"

@implementation ZM_Lbl_CollectionReuseV

#pragma mark - 赋值
-(void)setTextStr:(NSString *)textStr{
    _textStr = textStr;
    self.yyLbl.text = kIsEmptyStr(textStr)?@"":textStr;
}

-(void)setMattStr:(NSMutableAttributedString *)mattStr{
    _mattStr = mattStr;
    self.yyLbl.attributedText = mattStr;
}


#pragma mark - Methods


#pragma mark - Intial
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = kWhiteColor;
        [self setUpBaseData];
        [self setUpUI];
    }
    return self;
}

///基本数据设置
-(void)setUpBaseData{
    
}
///添加控件
-(void)setUpUI{
    [self bgV];
    [self yyLbl];
    [self lineV];
}


#pragma mark - lazyLoad
-(YYLabel *)yyLbl{
    if (!_yyLbl) {
        _yyLbl = [YYLabel new];
        _yyLbl.textColor = kBlackColor;
        _yyLbl.font = kMediumFont(14);
        [self addSubview:_yyLbl];
        [_yyLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.right.mas_equalTo(-15);
            make.top.mas_equalTo(8);
            make.bottom.mas_equalTo(-8);
        }];
    }
    return _yyLbl;
}

-(UIView *) lineV {
    if (!_lineV) {
        _lineV = [UIView new];
        _lineV.backgroundColor = kHexColor(0xEEEEEE);
        _lineV.hidden = YES;
        [self addSubview:_lineV];
        [_lineV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(self);
            make.left.mas_equalTo(15);
            make.right.mas_equalTo(-15);
            make.height.mas_equalTo(0.5);
        }];
    }
    return _lineV;
}

-(UIView *)bgV{
    if (!_bgV) {
        _bgV = [UIView new];
        _bgV.hidden = YES;
        _bgV.backgroundColor = kHexColor(0xFAFAFA);
        [self addSubview:_bgV];
        [_bgV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.right.mas_equalTo(-15);
            make.bottom.top.mas_equalTo(0);
        }];
    }
    return _bgV;
}

@end
